1. Field of the Invention
The present invention relates to a data coding method and a data coding device for coding video data and audio data according to the MPEG (Moving Picture Expert Group) standard.
2. Description of the Related Art
In recent years, there has been developed of a video recorder that codes video data and audio data according to the MPEG standard for data recording on a recording medium such as a DVD (Digital Versatile Disk) and a hard disk.
A data coding LSI mounted on the video recorder has an MPEG encoder for coding (encoding), for example, video data and audio data according to the MPEG standard. The MPEG encoder has a video encoder, a video ring buffer, an audio encoder, an audio ring buffer, a multiplexer, and a system ring buffer.
The video encoder encodes ITU-R656 video data in the MPEG2 video MP@ML format and writes the resultant data to the video ring buffer as PES (Packetized Elementary Stream) data.
The audio encoder encodes 12S audio data in the MPEG1 Audio Layer 2 format and writes the resultant data to the audio ring buffer as PES data.
The multiplexer multiplexes PES data read from the video ring buffer and PES data read from the audio ring buffer at predetermined timing to write the resultant data to the system ring buffer as a data stream of the MPEG2 system PS format. Note that the multiplexer multiplexes the data only when judging that it can write a new data stream to a third buffer.
In response to the activation of a stream output request signal supplied from an external device, the system ring buffer outputs an 8-bit parallel data stream to the external device together with a synchronous clock, a stream output enable signal, and so on.
Further, Japanese Unexamined Patent Application Publication Nos. Hei 8-130715 and Hei 8-223538, for example, have proposed a ring buffer control method for realizing reverse direction reproduction in an MPEG decoder for decoding (reproducing) data that are coded according to the MEPG standard.